<?php


namespace app\admin\controller;

use think\facade\View;

use think\Request;
use \app\admin\model\CustomerMessage as CustomerModel;
class CustomerMessage
{
    public function index()
    {
        $data= CustomerModel::where('status','0')
            ->order('talk_time','desc')
            ->field(['user_id','admin_id','content','talk_time','status'])
            ->with('user')
            ->select();

        $data && $data = $data->toArray();
        $arr = [];
        foreach ($data as $key=>$val){
                $arr[$val['user_id']] = $val;
        }
        View::engine()->layout(false);
        return  View::fetch();
    }

}
